After definition of the entity class receiver, the message passing tool which generates a class type for each method of receiver can be started.

Additionally the message passing tool generates send and receive procedures for communication.

The generated class types and the send/receive procedures can be used by another entity class (sender) which needs the service of receiver.

use work.channel_pkg.all;
use work.new_messages.all;
entity sender is
  port (reply_channel:in channel;
        send_channel:out channel);
end sender;

The package new_messages contains the class types which represent the messages and the send/receive procedures which have been generated by the message passing tool.


architecture a of sender is
begin
sending:
  process
    Variable a,b,c: integer;
  begin
    a := 5;
    b := 7;
    send_addition(a, b,
          send_channel, reply_channel);
    -- do something
    receive_addition(a, b, c,
          send_channel, reply_channel);
    wait;
  end process;
end a;

The names of the send/receive procedures are extended by a postfix _XXX where XXX means that the procedure corresponds to the XXX method. The in/inout parameters of the XXX method are given as parameters to the send method (a,b). The receive procedure has the inout/out parameters of the XXX method as parameters (a,b,c). The last parameters of the send/receive procedures are the communication channels.